<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>模拟配置管理 |模拟新增配置管理</title>
<@fm.header />
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<form id="ff" method="post" enctype="multipart/form-data">
	    <table>
	        <tr>
	            <td><label for="apkUpload">apk上传:</label></td>
	            <td colspan=3><input type="file" name="file" id="apk"></input></td>
	        </tr>

	        <tr>
	            <td><label for="version">系统版本号:(必须唯一)</label></td>
	             <td><input id="version" type="text" name="version" value="1.0" ></input></td>
	        </tr>	
	        
	        <tr>
	            <td><label for="type">手机类型</label></td>
	            <td>
	            	<select class="easyui-combobox" name="type" panelHeight="auto" style="width:155px" data-options="required:true">
		                <option value="1">谷歌</option>
	                	<option value="2">小米</option>
	                	<option value="3">CT</option>
		            </select>
	            </td>
	        </tr>	
	        
	         <tr>
	            <td><label for="bz">备注:</label></td>
	            <td><textarea class="easyui-validatebox" name="bz" style="width:200px;height:60px;" data-options="validType:'length[0,200]'" ></textarea></td>
	        </tr>
	        
	       
	    </table>
	</form>
	</div>
	<div region="south" border="false" style="text-align: center; padding: 5px 5px 5px 0;">
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="add()">提交</a>
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm();">重置</a>
	</div>
</div>

<script>
function add() {
	$('#ff').form(
	    'submit',
	    {
			url : '/system/add',
			
			onSubmit : function() {
				var version = $('#version').val();
				if (version==null||version.length<=0) {
					top.showMsg(market.content.title, '系统版本必填号', alert);
					return false;
				}
				$(this).attr("disabled", "disabled");
				showProcess(true, market.content.title,	market.content.submitting);
            
			},
			success : function(data) {
				showProcess(false);
				var data = eval("(" + data + ")");
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				}else if(data.return_code == '10'){
					$.messager.alert(market.content.title, data.return_msg);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			},
			onLoadError : function() {
				showProcess(false);
				$.messager.alert(market.content.title, market.content.networkError);
			}
		}); 
}
</script>
</body>
</html>